import request from '@/axios'
import type { TableData } from './types'
//分组管理列表
export const getTableListApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/api/v1/bnb/accounts.do', data })
}
export const saveTableApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: 'api/v1/bnb/update.do', data })
}
export const updatePasswordApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: 'api/v1/user/passwd.do', data })
}

export const getTableDetApi = (id: string): Promise<IResponse<TableData>> => {
  return request.get({ url: '/mock/example/detail', params: { id } })
}
export const delTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/mock/example/delete', data: { ids } })
}

// 获取用户页面数据
export const getUserPageApi = (): Promise<IResponse> => {
  return request.post({ url: '/api/v1/user/page.do' })
}
